/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Interface;

import LN.Alquileres.Hospedaje;
import LN.Varios.Hosteria;
import LN.Varios.Reserva;
import java.util.Calendar;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Lukas
 */
public class Vista_Reservas extends javax.swing.JPanel {

    private Hosteria unaHosteria;

    /**
     * Creates new form Vista_Reservas
     */
    public Vista_Reservas(Hosteria unaHosteria) {
        this.unaHosteria = unaHosteria;

        initComponents();

//        JPanel unPanel = GUIM.crear_tabla_Reservas(pnl_tabla_reservas);
        JTable unaTabla = GUIM.crear_tabla_Reservas();



        pnl_tbl_reservas.add(unaTabla);

        for (Reserva unaReserva : unaHosteria.getReservas()) {
            Calendar entro = Calendar.getInstance();
            entro.setTime(unaReserva.getDesdeFecha());
            int fecha_entrada = entro.get(Calendar.DAY_OF_MONTH);
            int habit = unaReserva.getDeHabitacion().getNumero();
            
            unaTabla.setValueAt(unaReserva, 2, habit);
//Calendar salio = Calendar.getInstance();
//entro.setTime(unaReserva.getDesdeFecha());



//int fecha_salida = salio.get(Calendar.DAY_OF_MONTH);;

        }



//        int semana_del_año = calendario.get(Calendar.WEEK_OF_YEAR);
//        int mes = calendario.get(Calendar.MONTH);
//        int anio = calendario.get(Calendar.YEAR);

        this.updateUI();
    }
    Calendar calendario = Calendar.getInstance();
    int semana_del_año = calendario.get(Calendar.WEEK_OF_YEAR);
    int mes = calendario.get(Calendar.MONTH);
    int anio = calendario.get(Calendar.YEAR);

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        pnl_detalles_reserva = new javax.swing.JPanel();
        pnl_btns_reservas = new javax.swing.JPanel();
        jTextField1 = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        pnl_tbl_reservas = new javax.swing.JPanel();

        setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.LINE_AXIS));

        pnl_detalles_reserva.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        pnl_btns_reservas.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jTextField1.setEditable(false);
        jTextField1.setBackground(new java.awt.Color(153, 153, 153));
        jTextField1.setFont(new java.awt.Font("Copperplate Gothic Light", 1, 18)); // NOI18N
        jTextField1.setForeground(new java.awt.Color(255, 255, 255));
        jTextField1.setText("Gestor de Reservas");
        jTextField1.setFocusable(false);
        jTextField1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField1ActionPerformed(evt);
            }
        });

        pnl_tbl_reservas.setMaximumSize(new java.awt.Dimension(600, 355));
        pnl_tbl_reservas.setPreferredSize(new java.awt.Dimension(590, 355));
        pnl_tbl_reservas.setLayout(new javax.swing.BoxLayout(pnl_tbl_reservas, javax.swing.BoxLayout.LINE_AXIS));
        jScrollPane1.setViewportView(pnl_tbl_reservas);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 762, Short.MAX_VALUE)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pnl_detalles_reserva, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jScrollPane1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pnl_btns_reservas, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 363, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(pnl_detalles_reserva, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(pnl_btns_reservas, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );

        add(jPanel1);
    }// </editor-fold>//GEN-END:initComponents

    private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField1ActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JPanel pnl_btns_reservas;
    private javax.swing.JPanel pnl_detalles_reserva;
    private javax.swing.JPanel pnl_tbl_reservas;
    // End of variables declaration//GEN-END:variables
}
